﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InnovTech.Data.Proxy
{
    /// <summary>
    /// The base class of a Proxy
    /// </summary>
    public abstract class ProxyBase : NamedObject, IProxy
    {
        private Type _targetType;
        private Dictionary<string, IProxyBehavior> _behaviors;

        public ProxyBase(string name, Type type)
        {
            Name = name;
            _targetType = type;
            _behaviors = new Dictionary<string, IProxyBehavior>();
        }

        /// <summary>
        /// Gets the type of the target object.
        /// </summary>
        public Type TargetType
        {
            get { return _targetType; }
            protected set { _targetType = value; }
        }

        /// <summary>
        /// Gets the behaviors on this proxy object.
        /// </summary>
        public IEnumerable<IProxyBehavior> Behaviors
        {
            get { return _behaviors.Values; }
        }

    }
}
